Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rate limiter in web server #26

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ahmadhabibi14
Copy link

@ahmadhabibi14 ahmadhabibi14 commented Jan 7, 2024

PR Checklist

  • purpose: Add rate limiter, Swagger UI, Swagger config generator
  • solution: Using package https://github.com/ulule/limiter to add rate limiter for fasthttp
  • solution: Add HTML file in W2/internal/example2/svelte/apidocs/index.html, and function to render it
  • solution: Add generator, in file W2/internal/example2/presentation/1_codegen_test.go

@kokizzu kokizzu self-requested a review January 7, 2024 06:07
W/engine.go Outdated
// * "D": day
//
// * 300 reqs/minute: "300-M"
rate, errLimiter := limiter.NewRateFromFormatted("300-M")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this configurable by user, eg.
engine.RateLimit = ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants